home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Nebula 2
/
Nebula Two.iso
/
SourceCode
/
MiniExamples
/
AppKit
/
PaginationLab
/
drawRect.psw
< prev
next >
Wrap
Text File
|
1995-06-12
|
1KB
|
62 lines
/* load postscript procedures into the current dps context */
defineps loadPSProcedures()
/inch { 72 mul } def
/drawGrid % x y drawGrid ...
% draws a grid on on 8x10 inch page at (x,y)
{
/yc exch def
/xc exch def
/yt yc def
/xt xc def
.4 .4 1 setrgbcolor
2 setlinewidth
1 1 7 { pop
/xt xt 1 inch add def
xt yc moveto 0 10 inch rlineto stroke
} for
1 1 9 { pop
/yt yt 1 inch add def
xc yt moveto 8 inch 0 rlineto stroke
} for
} def
endps
defineps drawRect(float x, y; char *str; char *num; boolean darkFlag)
% draws a page at (x,y) using the number represented by str and num
darkFlag { .4 0 0 setrgbcolor } {0 .7 0 setrgbcolor } ifelse
x y 8 inch 10 inch rectfill
1 1 .6 setrgbcolor
x 36 add y 36 add 7 inch 9 inch rectfill
x y drawGrid
/Times-Bold findfont 600 scalefont setfont
x 2 inch add y 2.25 inch add moveto
0 0 .2 setrgbcolor
(num) show
/Times-Bold findfont 200 scalefont setfont
x 2 inch add y 3.25 inch add moveto
30 rotate
1 .4 .4 setrgbcolor
(str) show
-30 rotate
endps